package com.example.demo.elasticsearch.service;

import com.example.demo.elasticsearch.entity.Goods;
import com.example.demo.elasticsearch.mapper.GoodsMapper;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequestBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Service;

import java.util.Iterator;
import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;

    @Autowired
    private ElasticsearchRestTemplate elasticsearchRestTemplate;


    @Override
    public void createIndex() {
        elasticsearchRestTemplate.createIndex(Goods.class);
    }

    @Override
    public void deleteIndex(String index) {

    }

    @Override
    public void save(Goods goods) {

    }

    @Override
    public void saveAll(List<Goods> list) {

    }

    @Override
    public Iterator<Goods> findAll() {
        return null;
    }

    @Override
    public Page<Goods> findByContent(String content) {
        return null;
    }

    @Override
    public Page<Goods> findByFirstCode(String firstCode) {
        return null;
    }

    @Override
    public Page<Goods> findBySecordCode(String secordCode) {
        return null;
    }

    @Override
    public Page<Goods> query(String key) {
        return null;
    }
}
